package org.example.versii.util;

import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author mojito
 * @Classname ZPathUtils
 * @Description TODO
 * @Date 2020/8/3 下午11:54
 **/
public class ZPathUtils {
    private ZPathUtils() {
    }


    /**
     * 得到znode的路径
     *
     * @param path
     * @return
     */
    public static String getPath(String... path) {
        String zpath = Stream.of(path).map(p -> {
            return p.startsWith("/") ? p : "/" + p;
        }).collect(Collectors.joining());
        return zpath;
    }
}
